package com.white.bean;

import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * -- ⑪　赞赏：赞赏ID、赞赏用户ID、被赞赏文章ID、支付方式ID、金额、备注、创建时间。
 *
 * create table reward(
 * rewardId int primary key AUTO_INCREMENT comment "打赏ID",
 * userId int comment "打赏用户ID",
 * foreign key(userId) REFERENCES user(userId) on delete cascade on update cascade,
 * articleId int comment "被打赏图书ID",
 * foreign key(articleId) REFERENCES article(articleId) on delete cascade on update cascade,
 * money double not null default 0 comment "打赏金额",
 * mark varchar(256) comment "备注",
 * createTime TIMESTAMP not null default CURRENT_TIMESTAMP comment "创建时间，默认当前时间戳"
 * );
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Reward implements Serializable {
    /*只能标注到一个属性列*/
    @TableId(value = "rewardId")
    private Long rewardId;
    private Long userId, articleId;
    private double money;
    private String mark, createTime;

    public Reward(Long userId, Long articleId, double money, String mark) {
        this.userId = userId;
        this.articleId = articleId;
        this.money = money;
        this.mark = mark;
    }
}
